package com.songtai.service.impl;

import java.io.Serializable;

import com.songtai.dao.TeamEliteDao;
import com.songtai.po.PhotoObj;
import com.songtai.service.TeamEliteService;
import com.songtai.util.PageBean;

/**
 * 团队精英Service
 * 
 * @author lx
 * 
 */
public class TeamEliteServiceImpl implements TeamEliteService {

	private TeamEliteDao teamEliteDao;

	@Override
	public void delTeamElities(String ids) {
		String temp = ids.substring(0, ids.length() - 1);
		String[] temp2 = temp.split(",");
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < temp2.length; i++) {
			sb.append("'" + temp2[i] + "',");
		}
		temp = sb.toString();
		temp = temp.substring(0, temp.length() - 1);
		String hql = "delete from PhotoObj where id in(" + temp + ")";
		teamEliteDao.deleteEntities(hql);
	}

	/**
	 * 分页查找所有信息
	 */
	@Override
	public PageBean findPageTeams(PageBean pageBean) {
		return teamEliteDao.findPageEntities(pageBean);
	}

	/**
	 * 查询详情
	 */
	@Override
	public PhotoObj findDesc(Serializable id) {
		return teamEliteDao.readObjectById(id);
	}

	@Override
	public Serializable saveTeam(PhotoObj obj) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void updateTeam(PhotoObj obj) {
		// TODO Auto-generated method stub

	}

	public void setTeamEliteDao(TeamEliteDao teamEliteDao) {
		this.teamEliteDao = teamEliteDao;
	}

}
